package br.com.millenium.service.ferramenta.processaction;

import lumis.doui.processaction.ProcessActionHandler;
import lumis.portal.PortalException;
import br.com.millenium.domain.manager.MilleniumManagerFactory;

@SuppressWarnings("rawtypes")
public class CheckDeleteTipoFerramentaProcessActionHandler extends ProcessActionHandler
{
	@Override
	public void processAction() throws PortalException 
	{
		String[] tipoFerramentasId = (String[])getParameter( "id" );
		
		for ( String tipoFerramentaId: tipoFerramentasId ) 
		{
			if ( !MilleniumManagerFactory.getFerramentaManager().isDeleteableTipoFerramenta(tipoFerramentaId, transaction))
				throw new PortalException( "STR_TIPOFERRAMENTA_IS_BEING_USED;", getResource( ) );
		}
	}
}